home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr51
/
postalbc.zip
/
POSTALBC.DOC
< prev
Wrap
Text File
|
1993-04-17
|
3KB
|
66 lines
POSTALBC
By: David Frankenbach
DF Software Development, Inc.
PO Box 87
Forest, VA 24551-0087
10010101001010100101000011110001100010010100001001011
Postal Bar Code Printer for the Hewlett Packard LaserJet or other printer
that uses PCL4 and above. An original article by Andrew Binstock in
C Gazette, Volume 5.2 was the starting point for these routines. I have adapted
the routines from C into dBASE IV 1.1. I have made several optimizations to the
PCL commands used by the original article.
I have included two versions of the dBASE IV code. POSTALBC.1 is the first
version of the optimized code. POSTALBC.2 makes use of printer macros to
reduce the printer I/O by a factor of 30. You should use POSTALBC.2 unless
your printing environment (shared printers) might cause macro interference
with other users.
Number of characters sent to printer:
Original PostalBC.1 PostalBC.2
5 Digit Zip 988 742 37
9 Digit Zip 1616 1214 53
As you can see PCL can be an very inefficient if not used to its fullest
capabilities. Sending 988 characters to print the bar code for a 5 digit
zipcode is ridiculous. Even after optimizing the PCL in POSTALBC.1 it still
takes 742 characters. Some other optimizations which aren't presented here
got the count down to 480. But when you look at the numbers when using
macros there is simply no comparison.
When you are printing envelopes by the hundreds you gain a large reduction in
I/O time, not to mention the calculation time.
To use the programs copy either POSTALBC.1 or POSTALBC.2 to POSTALBC.PRG.
You will have to position the printer cursor prior to calling PostalBC.
The barcode should start 3.875 to 4 inches from the right edge of the
envelope and the bottom of the barcode should be 0.25 inches from the bottom
edge.
To print the barcode use:
do PostalBC with "24551"
or
do PostalBC with "12345-6789"
The routines do not error check the argument, so make sure you send them
a character string zip_code, with numeric digits and '-' only (sorry Canadians
send me a copy of your barcode specification and maybe I can modify the
routines to handle them.)
If you are using POSTALBC.2 you must initialize the printer macros by:
do PostalBC_Init
before you issue any PostalBC calls.
The code has been tested on a Hewlett Packard LaserJet III but should work
on any HP printer from the LaserJet+ and up.